﻿using System;
using System.Linq;
using SampleApp.Domain;
using SampleApp.Data;
using System.Collections.Generic;
using COM.Data;
using COM.Web;
using COM.Service;
using SampleApp.Service;

namespace SampleApp.Web.Service
{
    /// <summary>
    /// 访问服务的快捷方式,集成常用的服务
    /// </summary>
    public interface IRuntime
    {
        IAppLogService DbLogService { get; }
        IWebPermissionService Permission { get; }
        IHttpRequestService HttpRequestService { get; }
    }

    public class AppRuntimeService : IRuntime
    {
        public IWebPermissionService Permission
        {
            get
            {
                return Unity.Instance.GetService<IWebPermissionService>();
            }
        }

        public IAppLogService DbLogService
        {
            get
            {
                return Unity.Instance.GetService<IAppLogService>();
            }
        }

        public IHttpRequestService HttpRequestService
        {
            get
            {
                return Unity.Instance.GetService<IHttpRequestService>();
            }
        }

    }

    

}
